#include<stdio.h>

int main(void)
{
	int m,n;
	scanf("%d",&n);
	
	while(m=inverse(n),m!=n)
	{
		printf("%d ",n);
		n+=m;
	}
	
	printf("%d ",m);
	
	return 0;
}
int inverse(int n)
{
    int x=0,y=0;

    while(n != 0)
    {
        x = n%10;
        y = (y + x) *10;
        n = n/10;
    }
    y = y /10;
    return y;
}
